<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>实现开关边框的显示</title>
	<style>
		.with-border {
			border: 1px solid red;
		}
	</style>
</head>
<body ng-app="app">
	<div ng-controller="ctrl">
		<div ng-class="isWithBorder?'with-border':''">
			做人最重要的开心。
		</div>
		<button ng-click="hideBorder()">
			{{isWithBorder?'关闭':'打开'}}
		</button>
	</div>

	<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.7/angular.js"></script>
	<script>
		let app = angular.module("app", []);
		app.controller("ctrl", ($scope) => {
			$scope.isWithBorder = false;
			$scope.hideBorder = () => $scope.isWithBorder = !$scope.isWithBorder;
		});
	</script>
</body>
</html>